package sketch.test;

import java.util.LinkedList;
import java.util.List;

import sketch.ounit.Observer;
import sketch.ounit.Values;
import sketch.specs.annotation.TestSketch;
import junit.framework.TestCase;

public class RandomValueWithSetUpTearDown extends TestCase {

	public List<String> l = null;
	
	@Override
	public void setUp() {
		if(l != null) {
			throw new RuntimeException("The list should be null, need to tear down.");
		}
		l = new LinkedList<String>();
		l.add("yyy");
		l.add("xxx");
	}
	
	@Override
	public void tearDown() {
		if(l == null) {
			throw new RuntimeException("The list should be NOT null, need to set up.");
		}
		l = null;
	}
	
	@TestSketch
	public void testTreeMap() {
		treemap.TreeMap map1 = Values.randomCreate(treemap.TreeMap.class);
		map1.put(1);
		
		l.add("hello");
		Observer.observeExpr(l.toString());
	}
	
}
